home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00a.txt / 000024_icon-group-sender _Fri Feb 4 13:42:53 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id NAA06340
  4.     for icon-group-addresses; Fri, 4 Feb 2000 13:42:45 -0700 (MST)
  5. Message-Id: <200002042042.NAA06340@baskerville.CS.Arizona.EDU>
  6. Date: Fri, 04 Feb 2000 07:57:00 -0700
  7. From: Steve Wampler <swampler@noao.edu>
  8. X-Accept-Language: en
  9. To: Kostas Oikonomou <oikonomou@att.com>,
  10.         icon-group <icon-group@optima.CS.Arizona.EDU>
  11. Subject: Re: calling a C routine from icont
  12. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  13. Status: RO
  14.  
  15. Kostas Oikonomou wrote:
  16. > Is it possible to call a C routine for which you have only a header available,
  17. > and whose code exists only in a library (no source available)?
  18. > I've looked through the code in the cfuncs directory, and I'm not sure if what I
  19. > want is doable.
  20. > My situation is that I have an X library that does specialized plotting of data,
  21. > and I'd like to call some of its routines from my Icon program.
  22. > Some example routine headers are
  23. > void hs_initialize(char *id_string);
  24. > void hs_update(void);
  25. > void hs_complete(void);
  26. > void hs_complete_and_wait(void);
  27. > void hs_histoscope(int return_immediately);
  28. > void hs_kill_histoscope(void);
  29. > int hs_create_1d_hist(int uid, char *title, char *category,
  30. >                         char *x_label, char *y_label,
  31. >                         int n_bins, float min, float max);
  32.  
  33. Kosta,
  34.  
  35. Yes, it is possible, but you'll need to do it indirectly.  That is, you'll
  36. need to write (in C) wrapper functions to convert the data types between
  37. Icon's view of the world and C's.  There are functions available to help
  38. with those conversions, check the documentation on calling C functions
  39. from Icon (sorry, but I've forgotten which document it is, but the
  40. icon web page should point you to it).
  41.  
  42. --
  43. Steve Wampler-  SOLIS Project, National Solar Observatory
  44. swampler@noao.edu
  45.